package com.newtouch.avmarketing.order.controller;

import com.newtouch.avmarketing.mgr.modules.avmarkrting.model.Result;
import com.newtouch.avmarketing.mgr.modules.avmarkrting.model.ResultCodes;
import com.newtouch.avmarketing.order.entity.vo.UserVo;
import com.newtouch.avmarketing.order.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/order")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/find")
    public Result findUser(Integer id){
        List<UserVo> userVos = userService.userVo(id);
        return Result.of(ResultCodes.SUCCESS_CODE,"查询成功",userVos);
    }
}
